package com.yyfax.pay.common.enums;


import org.apache.commons.lang3.StringUtils;

public enum ProtocolEnum {

    FUIOU_PROTOCOL("P00010", "富友协议支付");

    private String code;

    private String value;

    private ProtocolEnum(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public String getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public static ProtocolEnum form(String code) {
        if (StringUtils.isBlank(code)) {
            return null;
        }
        ProtocolEnum[] values = ProtocolEnum.values();
        for (ProtocolEnum value : values) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
